package com.liyiqing.secondhandmall.memberservice.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.liyiqing.commonservice.validator.ListValue;
import com.liyiqing.commonservice.validator.methodgroup.AddGroup;
import com.liyiqing.commonservice.validator.methodgroup.DeleteGroup;
import com.liyiqing.commonservice.validator.methodgroup.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 收货地址
 * 
 * @author LiYiQing
 * @email 1570865668@qq.com
 * @date 2022-02-18 22:47:22
 */
@Data
@TableName("member_user_receive_address")
public class MemberUserReceiveAddressEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	@Null(message = "新增时不可指定id",groups = {AddGroup.class})
	@NotNull(message = "修改或删除时必须指定id",groups = {UpdateGroup.class, DeleteGroup.class})
	private Long id;
	/**
	 * 账号id
	 */
	@NotNull(message = "新增或修改时必须指定账号id",groups = {AddGroup.class,UpdateGroup.class})
	private Long memberId;
	/**
	 * 收货人姓名
	 */
	@NotBlank(message = "新增或修改时必须填写收货人姓名",groups = {AddGroup.class,UpdateGroup.class})
	private String name;
	/**
	 * 电话
	 */
	@NotBlank(message = "新增或修改时必须填写手机号",groups = {AddGroup.class,UpdateGroup.class})
	private String phone;
	/**
	 * 省份/直辖市
	 */
	@NotBlank(message = "新增或修改时必须填写省份",groups = {AddGroup.class,UpdateGroup.class})
	private String province;
	/**
	 * 城市
	 */
	@NotBlank(message = "新增或修改时必须填写城市",groups = {AddGroup.class,UpdateGroup.class})
	private String city;
	/**
	 * 区
	 */
	@NotBlank(message = "新增或修改时必须填写区",groups = {AddGroup.class,UpdateGroup.class})
	private String region;
	/**
	 * 详细地址(街道)
	 */
	@NotBlank(message = "新增或修改时必须填写详细地址",groups = {AddGroup.class,UpdateGroup.class})
	private String detailAddress;
	/**
	 * 删除状态[0：删除；1：可用]
	 */
	@TableLogic(value="1",delval="0")
	@ListValue(values = {0,1},message = "账号状态只能是:【1(可用)】or【0(删除)】")
	private Integer status;

}
